/* px转换rem */
// 定义基础字体大小
@baseSize: 16rem;

/* flex布局 */
.flex(@dir: row, @justify: space-between, @align: center, @wrap: initial) {
  display: flex;
  flex-direction: @dir;
  justify-content: @justify;
  align-items: @align;
  flex-wrap: @wrap;
}

/* border 1px */
.border-1px(@position: bottom, @color: #EAEAEA, @height: 1px, @width: 100%) {
  position: relative;

  &::after {
    content: " ";
    display: block;
    position: absolute;
    @{position}: 0;
    left: 0;
    width: @width;
    height: @height;
    background-color: @color;
    transform: scaleY(0.5);
  }
}

/* 单行超出省略号 */
.ellipsis() {
  overflow: hidden;
  -ms-text-overflow: ellipsis;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 多行超出省略号 */
.ellipsisLine(@line : 2) {
  word-break: break-all;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: @line;
  overflow: hidden;
}
